package com.yt.generator.common;

/**
 * @Description ：
 * @Author ： 解风
 * @Date ： 2017/09/13 17:21
 */
public enum CodeEnum {
    /********************系统模块*********************/
    FAIL_HYSTRIX(-1,"服务器忙请稍后再试"),
    SUCCESS(0, "成功！"),
    FAIL(1, "失败！"),
    FAIL_2(2, "登录失效"),
    FAIL_3(3, "您无权限访问，请联系管理员"),
    FAIL_100001(100001, "程序错误，请联系管理员！"),
    FAIL_100002(100002, "请求参数错误"),
    FAIL_100003(100003, "网络异常"),
    FAIL_100004(100004, "签名错误"),
    FAIL_100005(100005, "服务器忙请稍后再试"),
    FAIL_100006(100006, "文件上传失败，请重新上传！"),
    FAIL_100007(100007, "添加失败"),
    FAIL_100008(100008, "修改失败"),
    FAIL_100009(100009, "删除失败"),
    FAIL_100011(100011, "保存失败"),
    FAIL_100012(100012, "当前状态不允许修改"),
    FAIL_100013(100013, "已点赞"),
    FAIL_100014(100014, "学院名重复"),
    FAIL_100015(100015, "策略名重复"),
    FAIL_100016(100016, "批量删除失败"),
    FAIL_100017(100017, "分数设置错误，不能被整除！"),
    FAIL_100018(100018, "知识点比例设置错误！"),
    FAIL_100019(100019, "知识点对应的题数不足！"),
    FAIL_100020(100020, "审批失败！"),
    FAIL_100021(100021, "导入失败！"),
    FAIL_100022(100022, "难题数不足！"),
    FAIL_100023(100023, "考试不存在！"),
    FAIL_100024(100024, "题数不足！"),
    FAIL_100025(100025, "容易题数不足！"),
    FAIL_100026(100026, "已创建试卷！"),
    FAIL_100027(100027, "试卷出题错误！"),
    FAIL_100028(100028, "考试分数总分设置和考题分值总和不一致！"),
    FAIL_100029(100029, "一科考试只能提交一次"),
    FAIL_100030(100030, "题库题数不足，请录题！"),
    FAIL_100031(100031, "已发布考试，不能修改！"),
    FAIL_100032(100032, "未找到该学生,请重新输入！"),
    FAIL_100033(100007, "未添加排序"),

    /********************用户模块*********************/
    FAIL_USER_200000(200000, "账号密码错误"),
    FAIL_USER_200001(200001, "旧密码错误"),
    FAIL_USER_200002(200002, "账号已存在"),


    /********************订单模块*********************/
    FAIL_ORDER_300000(300000, "当前订单未审核"),
    FAIL_ORDER_300001(300001, "用户id为空"),
    FAIL_ORDER_300002(300002, "订单已存在"),
    FAIL_ORDER_300003(300003, "图片数量小于3"),
    FAIL_ORDER_300004(300004, "当前订单状态不允许修改"),
    FAIL_ORDER_300005(300005, "订单已成交状态只能修改为已完结状态"),
    FAIL_ORDER_300006(300006, "订单未审核状态只能修改为审核通过状态或未审核通过状态"),
    FAIL_ORDER_300007(300007, "订单审核通过状态只能修改为未审核状态或已成交状态"),


    /********************文件模块*********************/
    FAIL_FILE_400000(400000, "上传文件为空"),
    FAIL_FILE_400001(400001, "保存文件失败"),
    FAIL_FILE_400002(400002, "当前文件配置对象不存在"),
    //excel上传 400003
    FAIL_FILE_400004(400004, "上传文件数组格式不一致"),
    FAIL_FILE_400005(400005, "文件路径为空"),


    /********************资料模块*********************/
    FAIL_DATUM_500000(500000, "该资料已点赞"),
    FAIL_DATUM_500001(500001, "该资料已收藏"),
    FAIL_DATUM_500002(500002, "该分类名已存在"),
    FAIL_DATUM_500003(500003, "该资料名已存在"),
    FAIL_DATUM_500004(500004, "当前分类暂无数据"),
    FAIL_DATUM_500100(500100, "该资料评论已点赞"),

    //pk
    FAIL_DATUM_500005(500005, "被邀请用户正在比赛,发起邀请失败"),
    FAIL_DATUM_500006(500006, "您还有未完比赛，不能发起邀请"),
    FAIL_DATUM_500007(500007, "您团队PK所选时间段已存在比赛"),
    FAIL_DATUM_500008(500008, "被邀请团队PK所选时间段已存在比赛"),
    FAIL_DATUM_500009(500009, "单人PK同一时间只能发起了一场比赛"),
    FAIL_DATUM_500010(500010, "被邀请人已发起了一场比赛，暂时不能邀请"),
    FAIL_DATUM_500011(500011, "您团队和该团队在PK时间范围内已有PK邀请"),
    FAIL_DATUM_500012(500012, "单人PK不能邀请自己"),
    FAIL_DATUM_500013(500013, "团队PK参赛人员还未选择"),
    FAIL_DATUM_500014(500014, "团队PK参赛人员小于2人"),
    FAIL_DATUM_500015(500015, "答题错误，请联系管理员"),
    FAIL_DATUM_500016(500016, "答题错误，请联系管理员！"),
    FAIL_DATUM_500017(500017, "团队PK赛错误，请联系管理员！"),
    FAIL_DATUM_500018(500018, "团队PK赛开始时间至少大于当前时间2分钟！"),

    //questions
    FAIL_LEARN_500030(500030, "当前分类已存在"),

    /********************分享模块*********************/
    FAIL_Share_600000(600000, "该关系已存在，请勿重复添加"),
    FAIL_Share_600001(600001, "该分享评论已点赞"),
    FAIL_Share_600002(600002, "该分享已点赞"),
    FAIL_SHARE_600003(600003, "分享未读消息更新失败"),

    /********************你问众答模块*********************/
    FAIL_KNOW_600030(600030, "你问众答未读消息更新失败"),


    /********************风采展示模块*********************/
    FAIL_Activity_700000(700000, "该风采展示评论已点赞"),
    FAIL_Activity_700001(700001, "该风采展示已点赞"),

    /********************大咖开课展示模块*********************/
    FAIL_Lesson_800000(800000, "该课程评论已点赞"),
    FAIL_Lesson_800001(800001, "该课程已点赞"),
    /********************登录模块*********************/
    FAIL_Login_1001(1001, "公司不存在"),
    FAIL_Login_1002(1002, "用户或密码错误"),
    //FAIL_Login_1003(1003, "登录过期"),
    /********************修改密码模块*********************/
    FAIL_Login_2001(2001, "修改密码失败"),
    FAIL_Login_2002(2002, "获取菜单权限错误"),
    /********************添加用户模块*********************/
    FAIL_AddUser_3001(3001, "登录用户已存在"),
    FAIL_AddUser_3002(3002, "角色不能为空"),
    FAIL_AddUser_3003(3003, "角色为空"),
    /********************考试模块*********************/
    FAIL_Exam_900000(900000, "多选题数不够，请联系管理员，添加考题！"),
    FAIL_Exam_900001(900001, "未到开考时间!"),
    FAIL_Exam_900002(900002, "改考试已结束!"),
    FAIL_Exam_900003(900003, "考试已开始10分以上，不能进入考试!"),
    FAIL_Exam_900004(900004, "该考试已参考，请勿重复参考!"),
    FAIL_Exam_900006(900006, "顺序题数不够，请联系管理员，添加考题！"),
    FAIL_Exam_900007(900007, "连线题数不够，请联系管理员，添加考题！"),
    FAIL_Exam_900009(900009, "考试开考时间已过，不能修改!"),
    FAIL_Exam_900010(900010, "考试班级不能为空!"),
    FAIL_Exam_900011(900011, "考试知识点不能为空!"),
    FAIL_Exam_900012(900012, "该学生不存在!"),
    FAIL_Exam_900013(900013, "还未到开始时间!"),
    FAIL_Exam_900014(900014, "考试已过期,您已迟到规定时间！"),
    FAIL_Exam_900015(900015, "考试不存在!"),


    FAIL_Exam_900016(900016, "答题卡不能为空!"),
    FAIL_Exam_900017(900017, "试卷不存在!"),
    FAIL_Exam_990001(990001, "试卷规则不存在!"),
    FAIL_Exam_900018(900018, "该考生考试已过期，不能提交再提交试卷！"),
    FAIL_Exam_900019(900019, "考试时间不能为空!"),


    FAIL_Exam_900020(900020, "单选题数不够，请联系管理员，添加考题！"),
    FAIL_Exam_900021(900021, "多选题数不够，请联系管理员，添加考题！"),
    FAIL_Exam_900022(900022, "不定项选题数不够，请联系管理员，添加考题！"),
    FAIL_Exam_900023(900023, "判断题数不够，请联系管理员，添加考题！"),
    FAIL_Exam_900024(900024, "填空题数不够，请联系管理员，添加考题！"),
    FAIL_Exam_900025(900025, "完形填空题数不够，请联系管理员，添加考题！"),
    FAIL_Exam_900026(900026, "阅读理解题数不够，请联系管理员，添加考题！"),
    FAIL_Exam_900027(900027, "未到提交考试时间！"),
    FAIL_Exam_900028(900028, "已提交试卷，不能重复提交！"),


    FAIL_User_800001(800001, "sessionId不能为空!"),
    FAIL_User_800002(800002, "sessionId过期，请重新登录!"),
    FAIL_Role_800003(800003, "超级管理员/班主任角色不能删除!"),
    FAIL_Role_800004(800004, "角色名称不能重复!"),
    FAIL_Menu_800005(800005, "菜单名称不能重复!"),
    FAIL_Questions_800006(800006, "您还有题未做完!"),


    PROD_Exam_Empty_1000001(1000001, "班级/学生/试卷不能为空!"),
    ;
    private int code;
    private String msg;

    CodeEnum(int code, String msg){
        this.code = code;
        this.msg = msg;
    }
    public static Boolean isSuccess(int code){

        return SUCCESS.getCode()==code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
